< previous page page_263 next page >

Page 263
Lastly, you learned how to write code that sets control colors to the Windows 95 default colors, how to create your own custom color scheme, and how to link your control colors to the color scheme selected with the Windows Control Panel color applet.
Day 5
Input Validation
On Day 5, you learned how to perform input validation on data entry forms. You learned that input validation tasks can be divided into three areas:
· Key filtering: Preventing unwanted keyboard input
· Field-level validation: Validating input for each field
· Form-level validation: Validating input across several fields
You also learned that you should ask yourself a few basic questions when you are developing validation rules for your form.
· Is it a required field?
· What characters are valid/invalid for this field? (Numeric input only, capital letters only, no spaces allowed, and so on.)
· For numeric fields, is there a high/low range limit? (Must be greater than zero and less than 1000, can't be less than 100, and so on.)
· Is there a list of valid values for this field? (Can the user enter only Retail, Wholesale, or Other; Name must already be in the Customer table, and so on.)
· Is this a conditional field? (If users enter Yes in field A, they must enter something in field C.)
You learned how to write keyboard filter validation functions using the Visual Basic 5 KeyPress event. You learned how to write field-level validation functions that check for valid input ranges, input that is part of a list of valid data, and input that is within minimum and maximum length requirements. You also learned how to write validation functions that make sure dependent fields have been filled out properly.
Finally, you learned how to use Visual Basic 5 to create your own custom control that incorporates all the validation techniques you learned in this chapter. You can use this ActiveX control in all your future Visual Basic projects.
You also applied your knowledge of bound data controls, Visual Basic 5 data entry form design, and validation processing to create the data entry form for the CompanyMaster data table.

 
< previous page page_263 next page >

If you like this book, buy it!